/******************************************************************
 * Copyright (c) 2007 - 2007, Simon Guerard, All rights reserved.
 * 
 * Projet de jeu de course au large.
 * 
 * This File is part of Sail-Race
 * 
 * Sail-Race is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 * 
 * Sail-Race is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with Sail-Race; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
package net.simcafamily.sailrace.core;

import java.awt.Component;

import javax.annotation.Resource;

import org.xnap.commons.i18n.I18n;
import org.xnap.commons.i18n.I18nFactory;

/**
 * @author bs238
 * 
 */
public abstract class AbstractView implements IView {

    private String nom;

    private String actionName;

    @Resource(name = "session")
    private Session session;

    @Resource(name = "baseVue")
    protected BaseVueJFrame baseVue;

    protected final I18n i18n = I18nFactory.getI18n(getClass());

    /**
     * Constructeur par defaut
     */
    public AbstractView() {
	super();
    }

    /**
     * @see net.simcafamily.sailrace.core.IView#buildContentPane()
     */
    @Override
    public abstract Component buildContentPane();

    /**
     * @see net.simcafamily.sailrace.core.IView#getAction()
     */
    @Override
    public String getActionName() {
	return actionName;
    }

    /**
     * @return the baseVue
     */
    public final BaseVueJFrame getBaseVue() {
	return baseVue;
    }

    /**
     * @see net.simcafamily.sailrace.core.IView#getNom()
     */
    @Override
    public String getNom() {
	return nom;
    }

    /**
     * @return the session
     */
    public final Session getSession() {
	return session;
    }

    /**
     * @see net.simcafamily.sailrace.core.IForward#isVueInstance()
     */
    @Override
    public boolean isVueInstance() {
	return true;
    }

    /**
     * @param pBaseVue
     *            the baseVue to set
     */
    public final void setBaseVue(BaseVueJFrame pBaseVue) {
	baseVue = pBaseVue;
    }

    /**
     * @see net.simcafamily.sailrace.core.IView#setNom(java.lang.String)
     */
    @Override
    public void setNom(final String pNom) {
	nom = pNom;
    }

    /**
     * @param pSession
     *            the session to set
     */
    public final void setSession(Session pSession) {
	session = pSession;
    }

}
